ModEditor.GUI.CheckBox = {}

function ModEditor.GUI.CheckBox:DrawEverything(x,y)
	if self.MouseOver then
		set_color(0.5,0.5,0.5,1)
	else
		set_color(0,0,0,1)
	end
	draw_disk(x+self.Height/2,y+self.Height/2,0,self.Height/2,10,10,0,360,0)
	if self.Checked then
		set_color(1,1,1,1)
		draw_disk(x+self.Height/2,y+self.Height/2,0,self.Height/4,10,10,0,360,0)
	end
	set_color(0,0,0,1)
	draw_text(self.Caption,x+self.Height+5,y)
end
function ModEditor.GUI.CheckBox:Activate()
	self.Activated = true
end
function ModEditor.GUI.CheckBox:Deactivate()
	self.Activated = false
end
function ModEditor.GUI.CheckBox:MouseDown(x,y)
	if x < self.Height then
		self.Checked = not self.Checked
		if self.OnCheck ~= nil then
			self:OnCheck()
		end
	end
end
function ModEditor.GUI.CheckBox:New(parent)
	local obj = ModEditor.GUI.BasicControl:New(parent)
	obj.Activate = self.Activate
	obj.Deactivate = self.Deactivate
	obj.MouseDown = self.MouseDown
	obj.DrawEverything = self.DrawEverything
	obj.OnCheck = nil
	obj.Checked = true
	obj.UseBorder = false
	obj.Caption = ""
	return obj
end
